package com.yc.sole.erp.request;

import com.yc.sole.common.enums.OptionType;
import com.yc.sole.common.enums.TrueOrFalse;
import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * Request对象
 *
 * @author yizuomin
 * @date 2024-01-13
 **/
@Data
public class CategoryAttributeReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 属性key
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String attributeKey;
    /**
     * 属性名称
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String name;
    /**
     * 分类id
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Long categoryId;
    /**
     * 是否支持手动添加 0否 1是
     */
    private TrueOrFalse manuallyAdded;
    /**
     * 选项类型 0单选 1多选 2手动输入
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private OptionType optionType;
    /**
     * 可选项 通过|分割
     */
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    private String optional;
    /**
     * 排序
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private Integer sort;
}
